﻿<%@ Page Title="" Language="C#" MasterPageFile="~/admin/main/AdminBase.Master" AutoEventWireup="true" CodeBehind="list_news.aspx.cs" Inherits="com.lifan.motorcycle.admin.cms.list_news" %>
<%@ Import Namespace="System.Collections.Generic" %>
<%@ Import Namespace="Model.Cms" %>
<%@ Import Namespace="Com.Ompchina.Lib.Text" %>
<asp:Content ID="Content1" ContentPlaceHolderID="cph_header" runat="server">
<script type="text/javascript">
    $(function () {
        Init.tableList(".list");
        Init.deleleAction();
    })
</script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cph_pagename" runat="server">
    内容管理 &gt; <%= ConvertAction("新闻") %>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="cph_pagelink" runat="server">
    <li><a href="add_news.aspx?action=add<%= base.GetQueryString() %>">添加新闻</a></li>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="cph_main" runat="server">
<%
    if (PageAction.Equals("list"))
    {
%>
<form runat="server" id="frm_listBlock">
<table class="table list" cellpadding="0" cellspacing="0">
    <tr>
        <th class="w100">搜索条件：</th>
    	<td class="item">
    	    新闻类别：<CustomUI:SubTermDDL runat="server" ID="ddlTerm"  ParentTermID="-1" ParentTermLabel="news" ShowTips="true" ShowRecursion="true" ></CustomUI:SubTermDDL>&nbsp;&nbsp;
    	    年份：<CustomUI:NumberSelect runat="server" ID="ddlYear" StartNumber="2009" EndNumber="2015" ShowTips="true" ></CustomUI:NumberSelect>
            上线状态：<CustomUI:YesOrNo runat="server" ID="ddlOnline"></CustomUI:YesOrNo>&nbsp;&nbsp;
            <asp:Button ID="btnSearch" runat="server" Text="过滤" onclick="btnSearch_Click" />
    	</td>
    </tr>
</table>
</form>
<br /><br />
<table class="table list" cellpadding="0" cellspacing="0">
    <tr>
        <th class="w100">编号</th>
	    <th class="w100">类别</th>
	    <th>新闻标题</th>
	    <th class="w100">推荐</th>
        <th class="w100">上线</th>
        <th class="w180">上线时间</th>
        <th class="w180">发布时间</th>
        <th class="center w100">操作</th>
    </tr>
    <%
    int recordcount = 0, pagesize = 20;
    IList<NewsInfo> list = this._GetNews(pagesize, out recordcount);
    if (list != null && list.Count > 0)
    {
        int i = 1; string css = string.Empty;
        foreach (NewsInfo info in list)
        {
            css = i++ % 2 == 1 ? "item" : "aitem";
                %>
                <tr class="<%= css %>">
                    <td><%= info.NewsID%></td>
                    <td><a href="list_news.aspx?action=list&termid=<%= info.NewsType.TermID %>"><%= info.NewsType.TermName %></a></td>
                    <td><%= info.NewsTitle%></td>
                    <td><%= info.Recommend.Equals("y") ? "是" : "否"%></td>
                    <td><%= info.IsOnline.Equals("y") ? "是" : "否"%></td>
                    <td><%= info.OnlineTime%></td>
                    <td><%= info.AddTime%></td>
                    <td class="center"><a href="add_news.aspx?action=update&id=<%= info.NewsID + base.GetQueryString() %>">修改</a></td>
                </tr>
                <%
    }
    }
    %>
    <tr>
        <th colspan="8" class="pager">
            <%
    Pager.ResponsePager(Response, "list_news.aspx"
        , "action=list" + base.GetQueryString()
        , true, true, true, true, PageIndex, pagesize, recordcount, 10); %>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;记录总数：<%= recordcount%>，每页显示<%= pagesize%>条记录，当前第<%= PageIndex%>页
       </th>
    </tr>
</table>
<%} %>
</asp:Content>